package com.java.design.pattern.decorator;

import java.math.BigDecimal;

/**
 * 葡萄的装饰器类继承CakeDecorator类
 *
 * @author xin.ding
 * @date 2020/10/29 18:14
 */
public class CakeAddGrapeDecorator extends CakeDecorator {

    public CakeAddGrapeDecorator(Cake cake) {
        super(cake);
    }

    @Override
    public String getCakeMsg() {
        return super.getCakeMsg() + "+1个葡萄";
    }

    @Override
    public BigDecimal getPrice() {
        return super.getPrice().add(BigDecimal.ONE);
    }
}
